from typing import List

"""
"""

class Solution:
    def decode(self, encoded: List[int]) -> List[int]:
        n = len(encoded)
        all = 0
        for i in range(1, n + 2):
            all ^= i

        print(all)

        # 计算[1] ^ [2] ^ [-1]
        value = 0
        for i in range(1,n,2):
            value ^= encoded[i]
        print(value)

        res = []
        res.append(value ^ all)
        for i in range(n):
            res.append(encoded[i] ^ res[i])

        return res
            


if __name__ == "__main__":
    Solution().decode([6,5,4,6])


